home *** CD-ROM | disk | FTP | other *** search
/ Amiga Magazin: Amiga-CD 1996 September & October / Amiga-CD 1996 #9-10.iso / demos / storm-c / stormc / include / dos / filehandler.h < prev    next >
C/C++ Source or Header  |  1994-03-15  |  5KB  |  125 lines

  1. #ifndef DOS_FILEHANDLER_H
  2. #define DOS_FILEHANDLER_H
  3. /*
  4. **    $VER: filehandler.h 36.6 (9.8.92)
  5. **    Includes Release 40.15
  6. **
  7. **    device and file handler specific code for AmigaDOS
  8. **
  9. **    (C) Copyright 1986-1993 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef      EXEC_PORTS_H
  14. #include "exec/ports.h"
  15. #endif
  16.  
  17. #ifndef      DOS_DOS_H
  18. #include "dos/dos.h"
  19. #endif
  20.  
  21.  
  22. /* The disk "environment" is a longword array that describes the
  23.  * disk geometry.  It is variable sized, with the length at the beginning.
  24.  * Here are the constants for a standard geometry.
  25.  */
  26.  
  27. struct DosEnvec {
  28.     ULONG de_TableSize;         /* Size of Environment vector */
  29.     ULONG de_SizeBlock;         /* in longwords: standard value is 128 */
  30.     ULONG de_SecOrg;         /* not used; must be 0 */
  31.     ULONG de_Surfaces;         /* # of heads (surfaces). drive specific */
  32.     ULONG de_SectorPerBlock; /* not used; must be 1 */
  33.     ULONG de_BlocksPerTrack; /* blocks per track. drive specific */
  34.     ULONG de_Reserved;         /* DOS reserved blocks at start of partition. */
  35.     ULONG de_PreAlloc;         /* DOS reserved blocks at end of partition */
  36.     ULONG de_Interleave;     /* usually 0 */
  37.     ULONG de_LowCyl;         /* starting cylinder. typically 0 */
  38.     ULONG de_HighCyl;         /* max cylinder. drive specific */
  39.     ULONG de_NumBuffers;     /* Initial # DOS of buffers.  */
  40.     ULONG de_BufMemType;     /* type of mem to allocate for buffers */
  41.     ULONG de_MaxTransfer;    /* Max number of bytes to transfer at a time */
  42.     ULONG de_Mask;         /* Address Mask to block out certain memory */
  43.     LONG  de_BootPri;         /* Boot priority for autoboot */
  44.     ULONG de_DosType;         /* ASCII (HEX) string showing filesystem type;
  45.                   * 0X444F5300 is old filesystem,
  46.                   * 0X444F5301 is fast file system */
  47.     ULONG de_Baud;         /* Baud rate for serial handler */
  48.     ULONG de_Control;         /* Control word for handler/filesystem */
  49.     ULONG de_BootBlocks;     /* Number of blocks containing boot code */
  50.  
  51. };
  52.  
  53. /* these are the offsets into the array */
  54. /* DE_TABLESIZE is set to the number of longwords in the table minus 1 */
  55.  
  56. #define DE_TABLESIZE    0    /* minimum value is 11 (includes NumBuffers) */
  57. #define DE_SIZEBLOCK    1    /* in longwords: standard value is 128 */
  58. #define DE_SECORG    2    /* not used; must be 0 */
  59. #define DE_NUMHEADS    3    /* # of heads (surfaces). drive specific */
  60. #define DE_SECSPERBLK    4    /* not used; must be 1 */
  61. #define DE_BLKSPERTRACK 5    /* blocks per track. drive specific */
  62. #define DE_RESERVEDBLKS 6    /* unavailable blocks at start.     usually 2 */
  63. #define DE_PREFAC    7    /* not used; must be 0 */
  64. #define DE_INTERLEAVE    8    /* usually 0 */
  65. #define DE_LOWCYL    9    /* starting cylinder. typically 0 */
  66. #define DE_UPPERCYL    10    /* max cylinder.  drive specific */
  67. #define DE_NUMBUFFERS    11    /* starting # of buffers.  typically 5 */
  68. #define DE_MEMBUFTYPE    12    /* type of mem to allocate for buffers. */
  69. #define DE_BUFMEMTYPE    12    /* same as above, better name
  70.                  * 1 is public, 3 is chip, 5 is fast */
  71. #define DE_MAXTRANSFER    13    /* Max number bytes to transfer at a time */
  72. #define DE_MASK        14    /* Address Mask to block out certain memory */
  73. #define DE_BOOTPRI    15    /* Boot priority for autoboot */
  74. #define DE_DOSTYPE    16    /* ASCII (HEX) string showing filesystem type;
  75.                  * 0X444F5300 is old filesystem,
  76.                  * 0X444F5301 is fast file system */
  77. #define DE_BAUD        17    /* Baud rate for serial handler */
  78. #define DE_CONTROL    18    /* Control word for handler/filesystem */
  79. #define DE_BOOTBLOCKS    19    /* Number of blocks containing boot code */
  80.  
  81. /* The file system startup message is linked into a device node's startup
  82. ** field.  It contains a pointer to the above environment, plus the
  83. ** information needed to do an exec OpenDevice().
  84. */
  85. struct FileSysStartupMsg {
  86.     ULONG    fssm_Unit;    /* exec unit number for this device */
  87.     BSTR    fssm_Device;    /* null terminated bstring to the device name */
  88.     BPTR    fssm_Environ;    /* ptr to environment table (see above) */
  89.     ULONG    fssm_Flags;    /* flags for OpenDevice() */
  90. };
  91.  
  92.  
  93. /* The include file "libraries/dosextens.h" has a DeviceList structure.
  94.  * The "device list" can have one of three different things linked onto
  95.  * it.    Dosextens defines the structure for a volume.  DLT_DIRECTORY
  96.  * is for an assigned directory.  The following structure is for
  97.  * a dos "device" (DLT_DEVICE).
  98. */
  99.  
  100. struct DeviceNode {
  101.     BPTR    dn_Next;    /* singly linked list */
  102.     ULONG    dn_Type;    /* always 0 for dos "devices" */
  103.     struct MsgPort *dn_Task;    /* standard dos "task" field.  If this is
  104.                  * null when the node is accesses, a task
  105.                  * will be started up */
  106.     BPTR    dn_Lock;    /* not used for devices -- leave null */
  107.     BSTR    dn_Handler;    /* filename to loadseg (if seglist is null) */
  108.     ULONG    dn_StackSize;    /* stacksize to use when starting task */
  109.     LONG    dn_Priority;    /* task priority when starting task */
  110.     BPTR    dn_Startup;    /* startup msg: FileSysStartupMsg for disks */
  111.     BPTR    dn_SegList;    /* code to run to start new task (if necessary).
  112.                  * if null then dn_Handler will be loaded. */
  113.     BPTR    dn_GlobalVec;    /* BCPL global vector to use when starting
  114.                  * a task.  -1 means that dn_SegList is not
  115.                  * for a bcpl program, so the dos won't
  116.                  * try and construct one.  0 tell the
  117.                  * dos that you obey BCPL linkage rules,
  118.                  * and that it should construct a global
  119.                  * vector for you.
  120.                  */
  121.     BSTR    dn_Name;    /* the node name, e.g. '\3','D','F','3' */
  122. };
  123.  
  124. #endif    /* DOS_FILEHANDLER_H */
  125.